﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using Broker.View.Comm;
using BrokerBase.Lib.Company;
using BrokerBase.Lib.Client;
using System.Windows.Controls;
using log4net;
using BrokerBase.Lib.Product;
using Broker.View.ViewModel;
using System.Windows;
using System.Windows.Media;


namespace Broker.View
{
    public enum AppType { Manager = 0, Business = 1 }

    public static class LibGlobal
    {
        public static ISessionFactory HbmSessionFactory { get; set; }

        public static BaseDataType[] BaseDataType { get; set; }

        //public static ICompany CurrentCompany { get; set; }

        //public static ClientConfiguration ClientCfg { get; set; }

        public static AppType AppType { get; set; }

        public static ContentControl MainWin { get; set; }

        public static ILog Log { get; set; }

        public static IEdition Edition { get; set; }

        public static Func<bool> IsActiveCallBack;

        public static bool IsActive 
        {
            get
            {
                if (LibGlobal.AppType == AppType.Manager)
                {
                    return true;
                }
                else
                {

                    if (IsActiveCallBack != null)
                        return IsActiveCallBack();
                    else
                        return false;
                }
            }
        }

        public static Func<string> GetAppPath { get; set; }

        //public static Func<string> GetAppDataPath { get; set; }

        public static Func<ICompany, IProduct> LoadTrialProduct;

        public static Func<ICompany> GetCurrentCompany{get;set;}

        public static Func<ClientConfiguration> GetClientCfg {get;set;}

        public static IList<ProductNameModel> ProductNames { get; set; }

        public static IList<PersonNameModel> PersonNames { get; set; }

        public static Window MainWindow { get; set; }

        public static SolidColorBrush DarkBackground { get; set; }
    }
}
